<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>藏品修改</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/laydate/skins/molv/laydate.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/webuploader/webuploader.css" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/webuploader/style.css" rel="stylesheet">
    <link href="/Public/Admin/css//plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style type="text/css">
        .divX
        {
            z-index:100;
            border-style:solid;
            border-width:1px;
            border-color:#FF0000;
            -moz-border-radius:20px;
            -webkit-border-radius:20px;
            background-color:#ffffff;
            line-height:10px;
            text-align:center;
            font-weight:bold;
            cursor:pointer;
            font-size:10px;
            color:red;
            display: none;
        }
    </style>
</head>


<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加管理员</h5>
                </div>
                <div class="ibox-content">
                    <form action="<?php echo U('Collection/editSave');?>" method="post" class="form-horizontal m-t" id="signupForm" enctype="multipart/form-data">
                        <input id="id" name="id" class="form-control" type="hidden" value="<?php echo ($info["id"]); ?>">
                        <input type="hidden" name="litpic" id="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">藏品名称：</label>
                            <div class="col-sm-8">
                                <input id="name" name="name" class="form-control" type="text" value="<?php echo ($info["name"]); ?>">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>必填</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">编号：</label>
                            <div class="col-sm-8">
                                <input id="number" name="number" class="form-control" type="text" value="<?php echo ($info["number"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">大类别：</label>
                            <div class="col-sm-8">
                                <select name="cates" id="cates" class="form-control m-b">
                                    <option>————请选择类别————</option>
                                    <?php if(is_array($cates)): foreach($cates as $key=>$va): ?><option value="<?php echo ($va["id"]); ?>" <?php if($va['id'] == $info['cates']): ?>selected<?php endif; ?>><?php echo ($va["columns"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">小类别：</label>
                            <div class="col-sm-8">
                                <select name="pid" id="pid" class="form-control m-b">
                                    <option>————请选择类别————</option>
                                    <?php if(is_array($pid)): foreach($pid as $key=>$vo): ?><option value="<?php echo ($vo["id"]); ?>" <?php if($vo['id'] == $info['pid']): ?>selected<?php endif; ?>><?php echo ($vo["columns"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">作者：</label>
                            <div class="col-sm-8">
                                <input id="author" name="author" class="form-control" type="text" value="<?php echo ($info["author"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">年份：</label>
                            <div class="col-sm-8">
                                <input id="age" name="age" class="form-control" type="text" value="<?php echo ($info["age"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">材质：</label>
                            <div class="col-sm-8">
                                <input id="material" name="material" class="form-control" type="text" value="<?php echo ($info["material"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">尺寸：</label>
                            <div class="col-sm-8">
                                <input id="size" name="size" class="form-control" type="text" value="<?php echo ($info["size"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">重量：</label>
                            <div class="col-sm-8">
                                <input id="weight" name="weight" class="form-control" type="text" value="<?php echo ($info["weight"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">发布时间：</label>
                            <div class="col-sm-8">
                                <input class="form-control layer-date"  name="pubdate" placeholder="YYYY-MM-DD hh:mm:ss" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value="<?php echo ($info["pubdate"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">缩略图：</label>
                            <div class="col-sm-8">
                                <?php if(is_array($picture)): foreach($picture as $key=>$vo): ?><span style="position: relative;"id="span<?php echo ($key); ?>"><img id="<?php echo ($key); ?>" alt="<?php echo ($key); ?>" src="<?php echo ($vo); ?>"  onmouseover="showDeleteDiv('<?php echo ($key); ?>');" onmouseout="imgOnmouseout(),hideDeleteDiv('<?php echo ($key); ?>');" style="width:50px;height:50px;padding-left:10px;"/></span><?php endforeach; endif; ?>
                                <div id="uploader">
                                    <div class="queueList">
                                        <div id="dndArea" class="placeholder">
                                            <div id="filePicker"></div>
                                            <p>或将照片拖到这里，单次最多可选300张</p>
                                        </div>
                                    </div>
                                    <div class="statusBar" style="display:none;">
                                        <div class="progress">
                                            <span class="text">0%</span>
                                            <span class="percentage"></span>
                                        </div><div class="info"></div>
                                        <div class="btns">
                                            <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">藏品介绍：</label>
                            <div class="col-sm-8">
                                <textarea id="container" name="content" type="text/plain">
                                    <?php echo ($info["content"]); ?>
                                </textarea>
                                <!-- 配置文件 -->
                                <script type="text/javascript" src="/Public/Admin//editor/ueditor.config.js"></script>
                                <!-- 编辑器源码文件 -->
                                <script type="text/javascript" src="/Public/Admin//editor/ueditor.all.js"></script>
                                <!-- 实例化编辑器 -->
                                <script type="text/javascript">
                                    var ue = UE.getEditor('container');
                                </script>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">关键字：</label>
                            <div class="col-sm-8">
                                <input id="keywords" name="keywords" class="form-control" type="text" value="<?php echo ($info["keywords"]); ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="col-sm-8">
                                <input type="checkbox" value="1" name="status" id="status" class="js-switch" checked>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit" id="submit">提交</button>
                                <button class="btn btn-defualt" type="reset" data-dismiss="modal" onclick="history.go(-1)">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/Admin/js/content.min.js?v=1.0.0"></script>
<script src="/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/plugins/switchery/switchery.js"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script src="/Public/Admin/js/plugins/webuploader/webuploader.js"></script>
<script src="/Public/Admin/js/plugins/webuploader/upload.js"></script>
<script src="/Public/Admin/js/jquery.form.js"></script>
<script src="/Public/Admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
<script>
    //表单验证自定义检测方法
    var id = <?php echo ($info["id"]); ?>;
    $(document).ready(function(){
        //表单验证
        $('#signupForm').validate({
            rules: {
                name: {
                    required: true
                },
                pubdate:{
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请输入产品名称！"
                },
                pubdate:{
                    required: '请选择发布时间'
                }
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    success:function(data){
                        if(data.status > 0){
                            layer.msg(data.msg, {icon: 6,time: 1000}, function(){
                                window.location.href="<?php echo U('Collection/index');?>";
                            });
                        }else{
                            layer.msg(data.msg, {icon: 5,time: 1000},function(){
                                window.location.href="<?php echo U('Collection/index');?>";
                            });
                        }
                    },
                    datatype:'json'
                });
                return false
            }

        });
        //开关按钮实例化
        var elem = document.querySelector('.js-switch');
        var switchery = new Switchery(elem, { });
    })
</script>
<script type="text/javascript">
    var imgFlag = false; //鼠标放在图片上标记
    var divFlag = false; //鼠标放在删除层上标记

    function showDeleteDiv(resourceCode){
        imgFlag = true;
        $("#"+resourceCode+"DIV").css("display","block");
    };

    function hideDeleteDiv(resourceCode){
        if(!imgFlag && !divFlag){
            $("#"+resourceCode+"DIV").css("display","none");
        }
    };

    function imgOnmouseout(){
        imgFlag=false;
    };

    function divOnmouseover(resourceCode){
        divFlag = true;
        showDeleteDiv(resourceCode);
    };

    function divOnmouseout(resourceCode){
        divFlag = false;
        if(imgFlag){
            showDeleteDiv(resourceCode);
        }else{
            hideDeleteDiv(resourceCode);
        }
    };

    function removeGroupNotActivitySharingPhotoByResourceCode(pic) {
        swal({
            title: "您确定要删除这条信息吗?",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "是的，我就是要删除！",
            cancelButtonText: "师傅刹一脚...",
            closeOnConfirm: false,
            closeOnCancel: false
            },
            function(isConfirm){
                if (isConfirm) {
                    $.ajax({
                        type:"post",
                        url:"<?php echo U('Collection/imgdel');?>",
                        dataType:"json",
                        data:{"pic":pic,"id":id}
                    }).done(function(data){
                        swal({
                            title:'永久删除！',
                            text:'删除成功',
                            type:'success',
                            confirmButtonText: "OK！"
                        },function(){
                            $("#span"+pic).remove();
                        });
                    }).error(function(data) {
                        swal("OMG", "删除操作失败了!", "error")
                    });
                } else {
                    swal("已取消", "您取消了删除操作！", "error");
                }
            });

    }

</script>
<script type="text/javascript">
    $(document).ready(function(){
        $("img").each(function(i){
            var divObj=$("<div onclick=removeGroupNotActivitySharingPhotoByResourceCode('"+$(this).attr('alt')+"'); onmouseover=divOnmouseover('"+$(this).attr('alt')+"'); onmouseout=divOnmouseout('"+$(this).attr('alt')+"');>×</div>");
            divObj.addClass("divX");
            divObj.attr("id",$(this).attr("alt")+"DIV");
            divObj.attr("title","删除图片"+$(this).attr('alt'));
            divObj.css({position:"absolute", left: $(this).position().left+45, top:$(this).position().top-10});
            $(this).parent().append(divObj);
        });
    });
</script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:16 GMT -->
</html>